package com.aim.analysis.records;

import com.aim.util.filters.Filter;

import java.util.ArrayList;
import java.util.Collection;
import java.util.List;

/**
 * User: Avraham Shvartzon
 * Date: 6/5/14
 */
public class GameReport {

    List<GameValueExtractor> valueExtractors = new ArrayList<GameValueExtractor>();

    public GameReport(List<GameValueExtractor> valueExtractors) {
        this.valueExtractors = valueExtractors;
    }

    public void printReport(Collection<Game> gameList, Filter<Game> gameFilter){
        for (GameValueExtractor valueExtractor : valueExtractors) {
            System.out.print(valueExtractor.name + "\t");
        }
        System.out.println();

        for (Game game : gameList) {
            if (gameFilter.accept(game) == false || game.isValid() == false){
                continue;
            }
            for (GameValueExtractor valueExtractor : valueExtractors) {
                System.out.print(valueExtractor.getValue(game) + "\t");
            }
            System.out.println();
        }
    }



}
